package com.deli.springboot.repository;

import com.deli.springboot.entity.Book;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;


@Repository
public class BookRepository {

    private final ConcurrentMap<Integer, Book> repository = new ConcurrentHashMap<>();

    private final static AtomicInteger idGenerator = new AtomicInteger();

    /**
     * 保存对象
     * @param book
     * @return
     */
    public int add(Book book) {
        return 1;
    }

    /**
     * 查询
     * @param book
     * @return
     */
    public List<Book> selectByExample(Book book) {
        ArrayList<Book> books = new ArrayList<>();
        return books;
    }
}
